/**
 * RTSP:
 */
#include "RTSPCapture.h"

int32_t RTSPCapture::openInput(AVFormatContext **ppFormatCtx, IPCameraDevice *pDevice) {
  AVDictionary *pOptions = nullptr;
  av_dict_set(&pOptions, "rtsp_transport", "tcp", 0);
  return avformat_open_input(ppFormatCtx, pDevice->stStream, nullptr, &pOptions);
}

void RTSPCapture::closeInput(AVFormatContext **ppFormatCtx) {
  avformat_close_input(ppFormatCtx);
}

const char *RTSPCapture::getClassName() {
  return "RTSPCapture";
}